fsck: Add test for --delete corruption, fix repair, and partial commit checks
authorJason Wessel <jason.wessel@windriver.com>
Wed, 10 Jul 2019 18:42:27 +0000 (14:42 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 9 Sep 2019 13:40:36 +0000 (13:40 +0000)
commitbdbce9d042585d32d45e6e9f81d0871ef8f6ec53
tree5b280ff67d415c37becc45129301be0fc02f4ee4
parentb709c3c67bcaf3651ff2dd1d5a5f8680cf20d50c
fsck: Add test for --delete corruption, fix repair, and partial commit checks

The ostree fsck test is aimed to check that it will still fail an fsck
if the repository has been repaired by fsck.  It also checks that a
pull operation corrects the error and ostree fsck will exit with zero.

The test was modeled after the following script:

rm -rf ./f1
mkdir -p ./f1
./ostree --repo=./f1 init --mode=archive-z2
mkdir -p ./trial
echo test > ./trial/test
./ostree --repo=./f1 commit --tree=dir=./trial --skip-if-unchanged --branch=exp1 --subject="test Commit"

rm -rf ./f2
mkdir -p ./f2
./ostree --repo=./f2 init
./ostree --repo=./f2 pull-local  ./f1

echo whoops > `find ./f2 |grep objects |grep \\.file `
./ostree fsck --repo=./f2 ; echo Exit: $?
./ostree fsck --delete --repo=./f2 ; echo Exit: $?
./ostree fsck --repo=./f2 ; echo Exit: $?
./ostree --repo=./f2 pull-local  ./f1
./ostree fsck --repo=./f2 ; echo Exit: $?

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
fsck: Update test so that it will pass on fs without xattrs

The fsck test does not require xattrs to prove that it works.  It is
simple enough to change it to use an archvie instead of a bare type
repository.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Closes: #1910
Approved by: cgwalters
Makefile-tests.am
tests/test-fsck-delete.sh [new file with mode: 0755]